package com.eh.template.swing;

import javax.swing.*;
import java.awt.*;

/**
 * Created by David on 2016/4/30.
 */
public class MyJFrame extends JFrame {
    public MyJFrame(String title) {
        super(title);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        this.setBounds(700, 300, 300, 300);
        this.setVisible(true);
    }

    @Override
    public void paint(Graphics g) {
        super.paint(g);
        g.drawString("I rule!", 100, 100);
    }

    public static void main(String[] args) {
        new MyJFrame("模板方法钩子演示");
    }
}
